<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<title>社区最新内容</title>
		<link href="../css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="../css/pullToRefresh.css" />
		<link rel="stylesheet" type="text/css" href="../css/app.css" />
		<link rel="stylesheet" type="text/css" href="../fonts/iconfont/iconfont.css" />
		<link rel="stylesheet" type="text/css" href="../css/global.css" />
		<style type="text/css">
			.mui-media-object img{max-height: 74px;min-height: 74px;max-width:105px;min-width: 105px;}
		</style>
	</head>

	<body ng-app="newApp" ng-controller="contentController">
		<header class="mui-bar mui-bar-nav bg_white">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title colorP"></h1>
		</header>
		<div id="refreshContainer" class="mui-content">
			<div></div>
			<ul class="mui-table-view  bg_white" ng-repeat="(index,vo) in notes">
				<li class="mui-table-view-cell mui-media" ng-repeat="(index,n) in vo">
					<a href="javascript:;" class="mui-clearfix" ng-click="openNoteDetail(n.uid,0,n.id)">
						<div class="mui-media-object mui-pull-right margin_tb_8px">
							<img ng-if="n.file_type==0" ng-src="{{n.subject}}">
							<img ng-if="n.file_type==1" ng-src="../img/video.png" style="background: #000;"/>
						</div>
						<ul class="mui-media-body mui-pull-left user_view">
							<li>
								<div class="user_pic mui-ellipsis"><img src="{{n.icon}}" /></div>
								<span class="padding_l">{{n.nick}}</span>
							</li>
							<li>
								<i  ng-if="n.file_type==0" class="iconfont mui-icon icon-color">&#xe615;</i>
								<i  ng-if="n.file_type==1" class="iconfont mui-icon icon-color">&#xe8b3;</i>
								<span class="padding_l">{{n.title}}</span>
							</li>
							<li>
								<i class="iconfont mui-icon icon-color">&#xe60a;</i>
								<span class="padding_l">{{n.tags}}</span>
							</li>
						</ul>
					</a>
				</li>
			</ul>
			<p class="mui-text-center font14 line-height44px" id="not_more" ng-if="not_more == 1">没有更多数据了~~~</p>
			<!--没有数据的时候显示-->
			<div class="mui-text-center line-height44px color999 font14 padding_tb20" ng-if="notes[0].length == 0"><i class="iconfont mui-icon font60">&#xe6e3;</i><br />没有更多数据了~~~</div>
		</div>
	</body>
	<script src="../js/mui.min.js"></script>
	<script src="../js/mui.pullToRefresh.js"></script>
	<script src="../js/mui.pullToRefresh.material.js"></script>
	<script src="../js/open.js"></script>
	<script src="../js/angular.min.js"></script>
	<script src="../js/jquery.min.js"></script>
	<script src="../js/apppublic.js"></script>
	<script src="../js/app/new_content.js"></script>
	<script type="text/javascript">
		(function($) {
			//阻尼系数
			var deceleration = mui.os.ios ? 0.003 : 0.0009;
			$('.mui-scroll-wrapper').scroll({
				bounce: false,
				indicators: false, //是否显示滚动条
				deceleration: deceleration
			});

			$.ready(function() {
				//循环初始化所有下拉刷新，上拉加载。
				$.each(document.querySelectorAll('.mui-content'), function(index, pullRefreshEl) {
					$(pullRefreshEl).pullToRefresh({
						down: {
							callback: function() {
								var self = this;
								setTimeout(function() {
									loadNews();
									self.endPullDownToRefresh();
								}, 1000);
							}
						},
						up: {
							callback: function() {
								var self = this;
								getValue();
								setTimeout(function() {
									self.endPullUpToRefresh();
								}, 1000);
							}
						}
					});
				});
			});
		})(mui);

		function loadNews() {
			var appElement = document.querySelector('[ng-controller=contentController]');
			$scope = angular.element(appElement).scope();
			resArry = [];
			cur_page=1;
			noMore = false;
			$scope.initView();
			$scope.$apply();
		}

		function getValue() {
			var appElement = document.querySelector('[ng-controller=contentController]');
			$scope = angular.element(appElement).scope();
			cur_page++;
			$scope.initView();
			$scope.$apply();
		}
	</script>

</html>